{extend name="main/main" /} {block name="main"}
<link rel="stylesheet" href="/skin/css/jqui.css" type="text/css" media="all" />
<link rel="stylesheet" href="/skin/css/jqgrid.css" type="text/css" media="all" />
<div class="layui-form layui-form-pane">
    <div class="push_data">
        <div class="layui-row">
            <div class="layui-col-xs9">
                <div class="layui-row layui-col-space3">
                    <div class="layui-col-xs4">
                        <div class="layui-form-item remove_margin reset_item">
                            <label class="layui-form-label">供应商</label>
                            <div class="layui-input-block">
                                <div id="nod_supplier" class="selectpage" nod="supplier" tip="请选择供应商" url="/index/service/supplier_list"></div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs4">
                        <div class="layui-form-item remove_margin reset_item">
                            <label class="layui-form-label">单据日期</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" id="time" placeholder="请输入单据日期" value="{php}echo date('Y-m-d',time());{/php}" />
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs4">
                        <div class="layui-form-item remove_margin reset_item">
                            <label class="layui-form-label">单据编号</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" id="number" placeholder="请输入单据编号" value="{php}echo get_number('CGRKD');{/php}" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="set_btn">
                <button class="layui-btn layui-btn-normal" onclick="save({$Think.get.id});">新增单据</button>
                <button class="layui-btn" onclick="replace();">重新载入</button>
            </div>
        </div>
    </div>
    <div class="layui-row top_12">
        <div class="layui-col-md12">
            <table id="data_table"></table>
        </div>
    </div>
    <div class="push_data">
        <div class="layui-row layui-col-space12 top_12">
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin">
                    <label class="layui-form-label">单据金额</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" id="total" placeholder="单据金额" disabled value="" />
                    </div>
                </div>
            </div>
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label" onclick="get_total();">实际金额</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" id="actual" placeholder="实际金额 | 点击左侧快捷录入" value="" />
                    </div>
                </div>
            </div>
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label">实付金额</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" id="money" placeholder="请输入实付金额" value="" />
                    </div>
                </div>
            </div>
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label">制单人</label>
                    <div class="layui-input-block">
                        <div id="nod_user" class="selectpage" nod="user" tip="请选择制单人" url="/index/service/user_list"></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label">结算账户</label>
                    <div class="layui-input-block">
                        <div id="nod_account" class="selectpage" nod="account" tip="请选择结算账户" url="/index/service/account_list"></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs4">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label" id="upload_region">单据附件</label>
                    <div class="layui-input-block" onclick="look_file(this);">
                        <input type="text" id="file" class="layui-input" placeholder="点击左侧区域上传" disabled nod="" value="" />
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12">
                <div class="layui-form-item remove_margin ">
                    <label class="layui-form-label">备注信息</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" id="data" placeholder="请输入备注信息" value="" />
                    </div>
                </div>
            </div>
            <more></more>
        </div>
    </div>
</div>
<script src="/skin/js/public/public_table.js" type="text/javascript" charset="utf-8"></script>
<script type="text/html" id="more_html">{php}hook_listen('formmore');{/php}</script>
<script type="text/javascript" charset="utf-8">
    var sys={php}echo json_encode(get_sys(['user_opt','enable_batch','enable_serial']));{/php};
    var warehouse_arr={php}echo get_warehouse();{/php};
    var formfield={php}echo get_formfield('orpurchase_main','jqgrid');{/php};
    var plug_val={nod_user:{php}echo get_selectpage('user',Session('is_user_id'));{/php}};
    var bill_info={$info|json_encode};
    sys.user_opt==0&&($('#nod_user').attr('disabled','disabled'));
</script>
<script src="/skin/js/public/jqgrid.js" type="text/javascript" charset="utf-8"></script>
<script src="/skin/js/public/selectpage.js" type="text/javascript" charset="utf-8"></script>
<script src="/skin/js/orpurchase/table.js" type="text/javascript" charset="utf-8"></script>
<script src="/skin/js/orpurchase/main.js" type="text/javascript" charset="utf-8"></script>
{/block}